package com.free.company.member.properties;

import org.apache.ibatis.session.ExecutorType;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 功能概述:
 * </p>
 * <p>
 * 功能详述:
 * </p>
 */
@Component
@PropertySource("classpath:${spring.profiles.active}/mybatis.properties")
@ConfigurationProperties(prefix = MybatisProperties.MYBATIS_PREFIX)
public class MybatisProperties {
    /*========================================================================*
     *                         Public Fields (公共属性)
     *========================================================================*/
    public static final String MYBATIS_PREFIX = "mybatis";
    /*========================================================================*
     *                         Private Fields (私有属性)
     *========================================================================*/
    /** * Config file path. */
    private String config;

    /** * Location of mybatis mapper files. */
    private Resource[] mapperLocations;

    /** * Package to scan domain objects. */
    private String typeAliasesPackage;

    /** * Package to scan handlers. */
    private String typeHandlersPackage;

    /** * Check the config file exists. */
    private boolean checkConfigLocation = false;

    /** * Execution mode. */
    private ExecutorType executorType = ExecutorType.SIMPLE;

    /*========================================================================*
     *                         Construct Methods (构造方法)
     *========================================================================*/

    /*========================================================================*
     *                         Public Methods (公有方法)
     *========================================================================*/
    public String getConfig()
    {
        return this.config;
    }


    public void setConfig(String config)
    {
        this.config = config;
    }


    public Resource[] getMapperLocations()
    {
        return this.mapperLocations;
    }


    public void setMapperLocations(Resource[] mapperLocations)
    {
        this.mapperLocations = mapperLocations;
    }


    public String getTypeHandlersPackage()
    {
        return this.typeHandlersPackage;
    }


    public void setTypeHandlersPackage(String typeHandlersPackage)
    {
        this.typeHandlersPackage = typeHandlersPackage;
    }


    public String getTypeAliasesPackage()
    {
        return this.typeAliasesPackage;
    }


    public void setTypeAliasesPackage(String typeAliasesPackage)
    {
        this.typeAliasesPackage = typeAliasesPackage;
    }


    public boolean isCheckConfigLocation()
    {
        return this.checkConfigLocation;
    }


    public void setCheckConfigLocation(boolean checkConfigLocation)
    {
        this.checkConfigLocation = checkConfigLocation;
    }


    public ExecutorType getExecutorType()
    {
        return this.executorType;
    }


    public void setExecutorType(ExecutorType executorType)
    {
        this.executorType = executorType;
    }
    /*========================================================================*
     *                         Private Methods (私有方法)
     *========================================================================*/
}
